﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LoRel {

    public delegate void IndexBucketCreatedHandler(Index index, IndexBucket bucket);

    public delegate void IndexChangeDelegate(Key index_key, TableChangeArgs args);

    public class TableChangeItem {
        public readonly TableRow NewValue;
        public readonly TableRow OldValue;

        public TableChangeItem( TableRow new_value, TableRow old_value ) {
            NewValue = new_value;
            OldValue = old_value;
        }
    }

    // for not lets not fuck with these guys. They should get fucked with a bit later. Let's go and implement shit.

    public class TableChangeArgs {
        private readonly ChangeType m_ChangeType;
        private readonly IEnumerable< TableChangeItem > m_ChangedItems;
        private readonly int m_ItemCount;

        public TableChangeArgs( ChangeType change_type, int item_count, IEnumerable< TableChangeItem > changed_items ) {
            m_ItemCount = item_count;
            m_ChangeType = change_type;
            m_ChangedItems = changed_items;
        }

        public int ItemCount { get { return m_ItemCount; } }
        public ChangeType ChangeType { get { return m_ChangeType; } }
        public IEnumerable< TableChangeItem > ChangedItems { get { return m_ChangedItems; } }
    }
}